# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=replayproxy
pkgver=1.1
pkgrel=5
groups=('blackarch' 'blackarch-forensic' 'blackarch-proxy')
pkgdesc='Forensic tool to replay web-based attacks (and also general HTTP traffic) that were captured in a pcap file.'
url='https://code.google.com/p/replayproxy/'
arch=('any')
license=('BSD')
depends=('python2' 'python2-dpkt' 'python2-pynids')
source=("https://replayproxy.googlecode.com/files/${pkgname}%20${pkgver}.zip")
sha512sums=('76bd83f03ebdd3b1eeebe8ba02f4d6804494ef7a')

package() {
  install -dm 755 "$pkgdir/usr/bin/"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README INSTALL
  install -Dm 644 COPYRIGHT "$pkgdir/usr/share/licenses/$pkgname/COPYRIGHT"

  rm -rf "replayproxy%201.1.zip" README INSTALL COPYRIGHT

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

